<!DOCTYPE html>
<html>
<body>
<script>
    /*主进程获取*/
    const { ipcRenderer } = require('electron')
    const updateOnlineStatus = () => {
        ipcRenderer.send('online-status-changed', navigator.onLine ? 'online' : 'offline')
    }
    window.addEventListener('online',  updateOnlineStatus)
    window.addEventListener('offline',  updateOnlineStatus)

    updateOnlineStatus()
    /*渲染进程获取*/
    /*const alertOnlineStatus = () => {
        alert("渲染进程获取-OnlineStatus："+navigator.onLine);
        // console.log 打印不出来
       // console.log("渲染进程获取-OnlineStatus："+navigator.onLine);
    }
    window.addEventListener('online',  alertOnlineStatus)
    window.addEventListener('offline',  alertOnlineStatus)
    alertOnlineStatus()*/
</script>
</body>
</html>
